#pragma once

#include <NCore.h>
#include <NImage.h>
#include <NLicensing.h>

class apSSImage
{
public:
	apSSImage(void);
	~apSSImage(void);
	static bool Init();
	static void Close();

	void CleanImage();

	//create
	bool CreateImage_file(const char* filename);
	bool CreateImage_data(const char* pData, int width, int height, 
		int bpp, int pixelFMT = 0);//format: 0-RGB24, 1-RGB32
	bool CreateImage_data_part(const char* pData, int width, int height, 
		int bpp, int left, int top, int desWidth, int desHeight,
		int pixelFMT = 0);//format: 0-RGB24, 1-RGB32
	bool CreateImage_image(HNImage hImage);
	bool CreateImage_image_part(HNImage hImage, int left, int top,
		int desWidth, int desHeight);
	//processing
	bool ConvertToGray();
	bool ConvertToMono();
	//output
	bool SaveImage_file(const char* filename);
	bool SaveImage_data(char *pData, int *dataLen);
	HNImage GetImageHandle(){return m_hImage;}
	HNImage* GetImageHandlePtr(){return &m_hImage;}
	bool FillBitmap(HBITMAP *phBMP);
	//into
	void DumpImageInfo();
private:
	HNImage m_hImage;
};
